%nichi
%Layout by Paul Gaggl, 06/17/09

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{AEJM}[2012/01/13]

%\RequirePackage{tikz,pgf}
%\RequirePackage{fancyhdr}
%\pagestyle{fancy}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Define some colors
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{color}
\definecolor{lightblue}{rgb}{0.91,0.918,0.957}
\definecolor{headingred}{rgb}{0.603,0.179,0.196}
\definecolor{salmon}{rgb}{0.996,0.945,0.886}
\definecolor{headingblue}{rgb}{0.335,0.532,0.707}

\def\abstractbgcolor{white} %color setting for abstract background
\def\sectionheadingcolor{black} %setting for section heading colors
\def\subsectionheadingcolor{black} %setting for section heading colors

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Define font family for general text
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\baselinestretch}{1}
\RequirePackage{times}
%\RequirePackage{bookman}
%\RequirePackage{newcent}
%\RequirePackage{palatino}
%\RequirePackage{palatcm}
%\RequirePackage{pslatex}
%\RequirePackage[T1]{fontenc}
%\RequirePackage[adobe-utopia]{mathdesign}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Page Layout
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setlength{\voffset}{-1in}
\setlength{\paperheight}{11in}
\setlength{\topmargin}{1in}
\setlength{\headheight}{0in}
\setlength{\headsep}{0in}
\setlength{\topskip}{0in}
\setlength{\textheight}{624pt}% 9in - 24pt (for page number)
\setlength{\footskip}{24pt}

\setlength{\paperwidth}{8.5in}
\setlength{\hoffset}{-1in}
\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{1in}
\setlength{\evensidemargin}{1in}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Preferences for float placement
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\textfraction}{0.05}
\renewcommand{\topfraction}{0.95}
\renewcommand{\bottomfraction}{0.95}
\renewcommand{\floatpagefraction}{0.35}
\setcounter{totalnumber}{5}



%\pagestyle{myheadings}
%\markboth{Paul Gaggl}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Define abstract
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\abstract}[1]{\def\abs{#1}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Define additional note in title
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\titlenote}[1]{\def\tnote{#1}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Put togehter title and abstract
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\maketitle}{% 
		{\twocolumn[%
			%title
			{\centering
				%set font for main title
				\fontsize{26}{10}%
				\fontfamily{phv}%
				\fontseries{b}% 
				\fontshape{n}%
				\selectfont %
				%print title
				\@title\\[0.5cm]%
				
				%set font for author
				{
					\fontsize{13}{18}%
					\fontfamily{phv}%
					\fontseries{m}% 
					\fontshape{n}%
					\selectfont %
					%
					%\color{headingred}
					\@author\\[0.5cm]
				}
				
				%set font for additional note in title
				\fontsize{13}{18}%
				\fontfamily{phv}%
				\fontseries{m}% 
				\fontshape{n}%
				\selectfont %
				%
				\today\\[0.5cm]%
				\tnote$\,$\\[1cm]%
			}%
			
			%place abstract
			{\parbox{\textwidth}{
				\centering
				\colorbox{\abstractbgcolor}{
					\parbox{15cm}{
						\fontsize{10}{12}%
						\fontfamily{phv}%
						\fontseries{m}% 
						\fontshape{sl}%
						\selectfont%
						%
						\abs%
					}%
				}%
				\\[1.5cm]%
			}}%
		]}%
} %


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Define section heading styles
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% info on dealing with headings can be found at:
% http://theoval.cmp.uea.ac.uk/~nlct/latex/thesis/node9.html
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\@afterheading}{\global\@nobreaktrue
    \everypar{\if@nobreak
                 \global\@nobreakfalse
                 \clubpenalty \@M
              \else \clubpenalty \@clubpenalty
                 \everypar{}\fi}}


\renewcommand{\section}{\@startsection
	{section}%                   					% the name
	{1}%                         					% the level
	{0mm}%                       					% the indent
	{-\baselineskip}%           					% the before skip
	{0.2\baselineskip}%          				% the after skip
	{\reset@font\sffamily\fontsize{16}{16}\color{\sectionheadingcolor}\selectfont\@afterheading}% the style
}%
\renewcommand{\subsection}{\@startsection
	{subsection}%                   					% the name
	{1}%                         					% the level
	{0mm}%                       					% the indent
	{-\baselineskip}%           					% the before skip
	{0.2\baselineskip}%          				% the after skip
	{\reset@font\sffamily\fontsize{14}{14}\color{\subsectionheadingcolor}\selectfont\@afterheading}% the style
}


